<template>
    <div class="maindiv" >

  <el-row :gutter="20"  type="flex" justify="center">
    <el-card class="main-card">
    <!-- <el-col :span="6"><el-card>目录</el-card></el-col> -->
    <el-col>
 
   <el-table
    :data="userList"
    
    border
    :default-sort = "{prop: 'index', order: 'descending'}"
    >
     
        <el-table-column type="index" sortable></el-table-column>
        <el-table-column prop="orgName" label="名称" sortable></el-table-column>
        <el-table-column prop="orgType" label="性质" sortable>
          <template slot-scope="scope" >
            <p v-if="scope.row.orgType===1">协会</p>
            <p v-if="scope.row.orgType===2">学校</p>
              <p v-if="scope.row.orgType===3">企业</p>
            <p v-if="scope.row.orgType===null"></p>
          </template>
        </el-table-column>
        <el-table-column prop="orgCity" label="城市" sortable></el-table-column>
       
      
       
      
      </el-table>

    </el-col>
    </el-card>
  </el-row>

<el-drawer
  title="此处是新闻标题"
  :visible.sync="drawer"
  :direction="direction"
  :before-close="handleClose">
  <span>新闻内容</span>
</el-drawer>
    </div>
</template>
<style lang="less" scoped>
.maindiv{
height: 100%;
width: 100%;
background-color: #efeeee;
}
.el-header{
width: 100%;
height: 200px;
}
.el-aside{
width: 100%;
height: 200px;


}
.el-card{
border-radius: 30px

}

.headcard{

    height: 100px;
}
.asidecard{
height: 100%;

}

.main-card{
height: 100%;
width: 800px;

}
</style><script>
  export default {
    data() {
      return {
        drawer: false,
        direction: 'rtl',
        userList: [],
          typeList: [
        {id:1,
typeName:'协会',
        },
         {id:2,
typeName:'学校',
        },
         {id:3,
typeName:'俱乐部',
        }
      ],
      };
    },
    created() {
    this.getOrgList();
    
  },
    methods: {
   async getOrgList() {
      const { data: res } = await this.$http.get("/organization/getOrgList");
      if (res.code !== 200) return this.$message.error(res.msg);
    
      this.userList = res.data;
    },
      
      
      
      handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
      },
       handleClick(row) {
        console.log(row);
      },  resetDateFilter() {
        this.$refs.filterTable.clearFilter('date');
      },
      clearFilter() {
        this.$refs.filterTable.clearFilter();
      },
      formatter(row, column) {
        return row.address;
      },
      filterTag(value, row) {
        return row.tag === value;
      },
      filterHandler(value, row, column) {
        const property = column['property'];
        return row[property] === value;
      }
    }
  };
</script>